import { EntitySchema } from '@mikro-orm/core';

export class LeCollectLog {
  id!: string;
  type: boolean = true;
  link!: string;
  json!: unknown;
  goodsId: number = 0;
  status?: boolean = true;
  AppID!: string;
  createdTime?: number = 0;
  updatedTime?: number = 0;
  deletedTime?: number = 0;
  isDeleted?: number = 0;
}

export const LeCollectLogSchema = new EntitySchema({
  class: LeCollectLog,
  properties: {
    id: { primary: true, type: 'string', columnType: 'bigint' },
    type: { type: 'boolean', default: true },
    link: { type: 'string', length: 2048 },
    json: { type: 'unknown', columnType: 'longtext' },
    goodsId: { type: 'number', default: 0 },
    status: { type: 'boolean', nullable: true, default: true },
    AppID: { type: 'string', fieldName: 'AppID', length: 50 },
    createdTime: { type: 'number', nullable: true, default: 0 },
    updatedTime: { type: 'number', nullable: true, default: 0 },
    deletedTime: { type: 'number', nullable: true, default: 0 },
    isDeleted: { type: 'number', columnType: 'tinyint', nullable: true, default: 0 },
  },
});
